#include<stdio.h>
#include<string.h>
#define  LT  "log.txt" 
int main()
{
  FILE*fp=NULL;
  char buffer[128];
  memset(buffer,0,sizeof(buffer));
  fp=fopen(LT,"w+");//读写权限
  char str[20]="linux so easy!";
  if(fp==NULL)
  {
    printf("open failed\n");
    return -1;
  }
  fwrite(str,sizeof(str),1,fp);

  fseek(fp,0,SEEK_SET);
  
  fread(buffer,sizeof(str),1,fp);

  
  
  printf("%s\n",buffer);





  fclose(fp);



  return 0;
}
